<include file="public/head" />
</head>
<body>
<div class="am-modal am-modal-alert" tabindex="-1" id="fq_alert">
  <div class="am-modal-dialog">
    <div class="am-modal-hd" id="fq_alert_title"></div>
    <div class="am-modal-bd" id="fq_alert_info">
    </div>
    <div class="am-modal-footer">
      <span class="am-modal-btn">确定</span>
    </div>
  </div>
</div>
<div class="am-modal am-modal-confirm" tabindex="-1" id="fq_confirm">
  <div class="am-modal-dialog">
    <div class="am-modal-hd" id="fq_confirm_title"></div>
    <div class="am-modal-bd" id="fq_confirm_info"></div>
    <div class="am-modal-footer">
      <span class="am-modal-btn" data-am-modal-confirm="">确定</span>
    </div>
  </div>
</div>

<div class="move">
    <header style="position:relative;z-index:999;background:#F54D23;">
    <a href="javascript:void(0);" onclick="back();" style="position:absolute;top:2px;color:#fff;width:45px;height:100%;padding-left:10px;font-size:25px;" class="am-inline-block am-text-middle am-icon-angle-left"><!-- <img src="/Public/assets/mobile/images/left.png" />--></a><div class="am-per-center am-text-center am-padding-vertical-sm" style="color:#fff;font-size:16px;">晒单广场</div>

</header>
<script>
    function back(){
       var last_page_url = (document.referrer);
       if(last_page_url){
          	window.history.back();
		}else{
			window.location.href ='{:U('Index/index')}';
		}
    }
</script>
    <ul class="am-tabs-nav am-nav am-nav-tabs" id="nav2">
        <li <if condition="$share_curr eq 'index'">class="am-active"</if> style="padding-right:0;padding-left:0;"><a href="{:U('Share/index')}">晒单广场</a></li> 
        <li style="padding-right:0;padding-left:0;"><a href="{:U('User/myshare')}">我的晒单</a></li>
        <li style="padding-right:0;padding-left:0;"><a href="{:U('Share/rank')}">晒单排行</a></li>
        <li style="float:right;"><a class="am-fr am-text-sm am-padding-horizontal-xs top_refer" style="background-color:#FFF;border:.1rem solid #F3E7E3;padding-top:3px;padding-bottom:3px;margin-top:6px;margin-bottom:3px;" href="{:U('User/share')}">我要晒单</a>
        </li>
    </ul>
    <style>
        #nav2{
            margin:0;
        }
        #nav2 li{
            height:100%;
            padding:0 5px;
        }
        #nav2 li.am-active{
            border-bottom:.3rem solid #F54D23;
        }
        #nav2 li.am-active a{
            color:#F54D23;
        }
       #nav2 li a{
            border:0;
            padding:10px 7px 7px 7px;
            font-size:1.4rem;
            color:#3d0505;
        }
    </style>
    <div class="am-cf"></div>
    <div class="am-margin-horizontal-sm am-margin-top-sm am-text-center am-text-sm am-hide">暂无晒单信息</div>
    <div class="am-text-sm am-padding-top-sm box" style="position:relative;z-index:1;">
        <ul>
        	<volist name="shares" id="vo">
            <li class="">
                <div class="am-padding-horizontal-sm">
                    <img src="{:avatar($vo['uid'], 200)}" alt="" class="am-circle am-margin-right-xs am-fl" style="width:40px;height:40px;margin-top:2px;">
                    <div class="info_box" style="position:relative;top:2px;">
                        <span>{:getUsername($vo['uid'])}</span>
                        <div class="praise_click am-fr" data-id="{$vo.id}">
                            <i class="am-icon-thumbs-o-up"></i> <span class="praise_click_num">{$vo.praise}</span>
                        </div> 
                    </div>
                    <div class="" style="color:#8f8f8f;">
                        <span class="am-text-xs">{$vo.add_time|frienddate}</span>
                    </div>
                </div>
                <div class="am-cf"></div>
                <div class="am-margin-horizontal-sm">
                    <div class="am-margin-vertical-xs">{$vo.content|htmlspecialchars_decode}  </div>
                    <div class="image_show am-margin-top-xs am-gallery am-gallery-default am-no-layout" data-am-widget="gallery" data-am-gallery="{ pureview: true }" style="padding-left:0;margin-left:0;">
                    <php> 
                      $images = explode(',',$vo['img']);
                      for($i=0;$i<count($images);$i++){
						$img_url = $images[$i];
						echo '<img src="'.$img_url.'" style="max-width:200px;" data-am-pureviewed="1">'; 
                      }
                    </php>
                    
					</div>
                    <div class="am-margin-top-xs star">
                        <div>
                            <span>到手价：<span class="am-text-sm" style="font-weight:400;color:#f54d23">{$vo.price}</span>元</span>
                            <span class="am-fr">奖励积分：<span class="am-text-sm">{$vo.score}</span></span>
                        </div>
                        <div style="margin-right:2px;">
                            <span>评分：</span>
                            <php> 
                            for($i=1;$i<=5;$i++){
                            	if($i<=$vo['pingfen'])
                            		echo '<i class="am-icon-star"></i>';
                            	else
                            		echo '<i class="am-icon-star-0"></i>';
                            }
                            </php>
                         </div>
                    </div>
                </div>
                <div class="am-cf"></div>
            </li>
            <hr data-am-widget="divider" style="margin:10px;color:#f3e7e3;" class="am-divider am-divider-solid am-no-layout">
		</volist>
         </ul>
        <!--<ul class="am-pagination am-pagination-centered am-text-xs" id="page"> {$page}</ul>-->
    </div>
</div>
<include file="public/foot" />
<div class="am-hide"></div>

<style>
    .move{
        margin-bottom:49px;
        font-family:'Microsoft YaHei';
    }
    .nav.am-active{
        color:#F54D23;
    }
    .nav{
        color:#3d0505;
        display:inline-block;
    }
    .top_hr{
        margin:5px 0 10px;
        background-color:#f8f8f8;
        border:0;
        height:.5rem
    }
    .box ul{
        margin:0;
        padding:0;
        list-style:none;
    }
    .move .box ul li{
        padding:0;
        color:#3d0505;
    }
    .image_show img{
        margin-bottom:5px;
    }
    .star i{
        color:rgb(255,215,000);
    }

	.am-nav-tabs{
	border-bottom:0.1rem solid #f3e7e3;
}	

</style>
<script>
    $('.praise_click').one('click',function(){
        //晒单id
        var me = $(this);
        var id = me.data('id');
        var praise_click_num = me.children('.praise_click_num');
        var num = parseInt(praise_click_num.text())+1;
        praise_click_num.text(num);
        me.children('i').attr('class','am-text-danger am-icon-thumbs-up');
        $.ajax({
            type:'post',
            dataType:'json',
            data:{"id":id},
            url:'{:U('Share/praise')}',
            success:function(res){
            }
        });   
    });
</script>
</body>
</html>